package sword_to_1;

public class LeeCode_04 {
    public static void main(String[] args) {

    }
    private static boolean findNumberIn2DArray(int[][] matrix, int target) {
        int m = matrix.length;
        if (m == 0)
            return false;
        int n = matrix[0].length;
        int i = 0;
        int j = n - 1;
        while (i < m && j >= 0){
            int num = matrix[i][j];
            if (num == target)
                return true;
            else if (num > target){
                j--;
            }else{
                i++;
            }
        }
        return false;
    }
}
